let store = {
    // 状态
    state: {
        count: 1,
        name: 'lee',
        show: true,
        arr: []
    },

    //操作
    mutations: {
        add(state){
            state.count++;
        },
        reduce(state){
            state.count--;
        }
    },

    // 执行多个motation操作
    actions: {
        add(context){
            context.commit('add');
        },
        reduce(context){
            context.commit('reduce');
        }
    },

    // getter
    getters: {
        // count(state){
        //     return state.count;
        // }

        countMap: state => state.count,
        showMap: state => state.show,
        arrmap: state => state.arr
    }
    
}

export default store;